using EarthUtility;
using Unity.Mathematics;
namespace Geometry
{
    public class Ray
    {
        public double3 Origin { get; set; }
        public double3 Direction { get; set; }

        public Ray(double3 origin, double3 direction)
        {
            Origin = origin;
            Direction = direction;
            if (!Mathd.equalsEpsilon(math.length(direction), 1.0, Mathd.EPSILON6))
            {
                throw new System.Exception("direction must be normalized.");
            }
        }

        public static Ray operator -(Ray b)
        {
            return new Ray(b.Origin, -b.Direction);
        }

    }

}